package config

import (
	"encoding/json"
	"fmt"
	"os"
)

type Configuration struct {
	SecretId  string
	SecretKey string
	Domain    string
	RecordId  uint64
	SubDomain string
}

var myConfig Configuration

func init() {
	file, _ := os.Open("config/config.json")
	defer func(file *os.File) {
		err := file.Close()
		if err != nil {

		}
	}(file)
	decoder := json.NewDecoder(file)
	myConfig = Configuration{}
	err := decoder.Decode(&myConfig)
	if err != nil {
		fmt.Println("error:", err)
	}
}

func GET() *Configuration {
	return &myConfig
}
